﻿using ReflectionStudio.Components.UserControls;
using ReflectionStudio.Core.Events;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using WPFExcelReport.Controls;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for ChartEx.xaml
    /// </summary>
    public partial class TMUCLIENT
    {
        //获取该用户菜单并显示
        public TMUCLIENT()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VICC_MENUDEF();
            this.DataContext = MV;
            try
            {
                InitializeComponent();
            }
            catch(Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            } 
        }
        public override void LOADBYAUF()
        {
            try
            {
                dwData = TBMain.NewRow();
                dwData["MANDANT"] = app.Mandant;
                dwData["COMPANY"] = app.company;
                dwData["USERID"] = ORDERNUM.Trim().PadRight(8);
                SResult = TMV.QueryICC_MENUDEF(dwData, 2);
                MergeData(SResult, false, true);
              
                foreach (DataRow dwUMenu in TBMain.Rows)
                {
                    TXTBTN cb = new TXTBTN();
                    string header = Helper.GetGB2312Value(dwUMenu["HEADER"].ToString().Trim());
                    cb.Header = header;
                    cb.KEY = dwUMenu["TAG"].ToString().Trim();
                    root.Children.Add(cb);
                  

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("请检查服务器是否联通");
            }
        }

    }
}
